<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/12/11
 * Time: 16:26
 */

namespace app\admin\model;


use traits\model\SoftDelete;

class ServiceDetails extends Base
{
    use SoftDelete;

    protected $autoWriteTimestamp = 'datetime';

    public function getStatusAttr($value)
    {
        $status = [1=>'应用',2=>'禁用'];
        return $status[$value];
    }

    public function getIsShowAttr($value)
    {
        $status = [1=>'是',2=>'否'];
        return $status[$value];
    }

    public function serviceCategory(){
        return $this->belongsTo('service_category','category','id');
    }
}